/*
 Navicat Premium Data Transfer

 Source Server         : 本地 - localhost
 Source Server Type    : MySQL
 Source Server Version : 80022
 Source Host           : 127.0.0.1:3306
 Source Schema         : ali_hr

 Target Server Type    : MySQL
 Target Server Version : 80022
 File Encoding         : 65001

 Date: 11/07/2022 00:16:48
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for ali_admin
-- ----------------------------
DROP TABLE IF EXISTS `ali_admin`;
CREATE TABLE `ali_admin` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '管理员主键ID',
  `name` varchar(64) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '用户名',
  `password` varchar(64) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '密码',
  `status` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '启用' COMMENT '状态',
  `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime DEFAULT NULL COMMENT '更新时间',
  `deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
  `last_login_at` datetime DEFAULT NULL COMMENT '上次登录时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of ali_admin
-- ----------------------------
BEGIN;
INSERT INTO `ali_admin` VALUES (3, 'admin', '123456', '启用', '2021-12-18 23:52:36', '2021-12-18 23:52:36', NULL, NULL);
INSERT INTO `ali_admin` VALUES (4, 'alisleepy', '123456', '启用', '2021-12-19 02:11:01', '2021-12-19 02:11:01', NULL, NULL);
COMMIT;

-- ----------------------------
-- Table structure for ali_attachment
-- ----------------------------
DROP TABLE IF EXISTS `ali_attachment`;
CREATE TABLE `ali_attachment` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '附件表主键ID',
  `business` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '业务类型',
  `suffix` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '文件后缀，xls,csv',
  `file_name` varchar(255) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '文件名称',
  `file_path` varchar(255) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '文件路径',
  `status` varchar(32) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '状态，未下载，下载中，已下载',
  `percent` int NOT NULL DEFAULT '0' COMMENT '下载进度',
  `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime DEFAULT NULL COMMENT '更新时间',
  `deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of ali_attachment
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for ali_company
-- ----------------------------
DROP TABLE IF EXISTS `ali_company`;
CREATE TABLE `ali_company` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `name` varchar(255) COLLATE utf8mb4_general_ci NOT NULL COMMENT '公司名称',
  `staff_id` int NOT NULL COMMENT '公司法人ID',
  `staff_name` varchar(255) COLLATE utf8mb4_general_ci NOT NULL COMMENT '公司法人姓名',
  `start_date` date NOT NULL COMMENT '成立日期',
  `address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '公司注册地址',
  `status` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '未启用' COMMENT '状态，启用，未启用',
  `created_at` datetime DEFAULT NULL COMMENT '添加时间',
  `updated_at` datetime DEFAULT NULL COMMENT '更新时间',
  `deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of ali_company
-- ----------------------------
BEGIN;
INSERT INTO `ali_company` VALUES (1, '阿狸科技有限公司', 1, '王1', '2021-01-01', '北京市昌平区沙河镇', '启用', '2021-01-01 11:26:49', '2021-01-01 11:26:49', NULL);
INSERT INTO `ali_company` VALUES (2, '太原市阿狸科技有限公司', 2, '王2', '2022-04-05', '山西省太原市万柏林区', '未启用', '2022-04-05 11:34:08', '2022-04-05 11:34:10', NULL);
COMMIT;

-- ----------------------------
-- Table structure for ali_department
-- ----------------------------
DROP TABLE IF EXISTS `ali_department`;
CREATE TABLE `ali_department` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '部门名称',
  `parent_id` int NOT NULL DEFAULT '0' COMMENT '父级部门ID',
  `leader_id` int NOT NULL DEFAULT '0' COMMENT '部门负责人id',
  `id_path` varchar(255) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '部门id_path,各级部门id组成',
  `name_path` varchar(255) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '部门name_path，各级部门name组成',
  `level` tinyint(1) NOT NULL COMMENT '部门等级',
  `company_id` int NOT NULL COMMENT '部门所属公司ID',
  `status` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '部门状态，未生效，生效，封存',
  `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime DEFAULT NULL COMMENT '更新时间',
  `deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of ali_department
-- ----------------------------
BEGIN;
INSERT INTO `ali_department` VALUES (1, '阿狸科技有限公司', 0, 1, '1', '阿狸科技有限公司', 0, 1, '生效', '2022-04-23 23:20:00', '2022-04-23 23:20:03', '2022-04-23 23:21:40');
INSERT INTO `ali_department` VALUES (2, '人力资源部', 0, 1, '2', '人力资源部', 1, 1, '生效', '2022-03-27 20:40:11', '2022-03-27 20:40:13', NULL);
INSERT INTO `ali_department` VALUES (3, '员工关系组', 2, 1, '2-3', '人力资源部-员工关系组', 2, 1, '生效', '2022-03-27 20:40:54', '2022-03-27 20:40:56', NULL);
INSERT INTO `ali_department` VALUES (4, '产品研发部', 0, 1, '4', '产品研发部', 1, 1, '生效', '2022-03-27 20:41:50', '2022-03-27 20:41:52', NULL);
INSERT INTO `ali_department` VALUES (5, '设计组', 4, 1, '4-5', '产品研发部-设计组', 2, 1, '生效', '2022-03-27 20:42:41', '2022-03-27 20:42:43', NULL);
INSERT INTO `ali_department` VALUES (6, '服务端研发组', 4, 1, '4-6', '产品研发部-服务端研发组', 2, 1, '生效', '2022-04-05 11:31:18', '2022-05-02 00:29:36', NULL);
INSERT INTO `ali_department` VALUES (7, 'golang开发组', 6, 1, '4-6-7', '产品研发部-服务端研发组-golang开发组', 3, 1, '生效', '2022-04-05 11:33:01', '2022-05-02 00:29:36', NULL);
INSERT INTO `ali_department` VALUES (11, 'php开发组', 6, 2, '4-6-11', '产品研发部-服务端研发组-php开发组', 3, 2, '生效', '2022-04-11 00:11:45', '2022-05-02 00:29:36', NULL);
INSERT INTO `ali_department` VALUES (12, 'java开发组', 6, 2, '4-6-12', '产品研发部-服务端研发组-java开发组', 3, 2, '生效', '2022-04-13 23:34:46', '2022-05-02 00:29:36', NULL);
COMMIT;

-- ----------------------------
-- Table structure for ali_mobile
-- ----------------------------
DROP TABLE IF EXISTS `ali_mobile`;
CREATE TABLE `ali_mobile` (
  `id` int NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `brand` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '品牌',
  `model` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '型号',
  `owner_id` int NOT NULL DEFAULT '0' COMMENT '所属用户ID',
  `owner_name` varchar(255) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '所属用户姓名',
  `current_owner` varchar(255) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '当前在谁手里',
  `status` varchar(255) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '当前状态：空闲，已借出，无法使用',
  `lend_time` datetime DEFAULT NULL COMMENT '借出时间',
  `return_time` datetime DEFAULT NULL COMMENT '归还时间',
  `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime DEFAULT NULL COMMENT '更新时间',
  `deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of ali_mobile
-- ----------------------------
BEGIN;
INSERT INTO `ali_mobile` VALUES (1, 'vivo', 'X60', 1, '王凯凯', '李鸽', '已借出', '2022-07-11 00:15:37', NULL, '2022-07-10 15:09:08', '2022-07-11 00:15:37', NULL);
INSERT INTO `ali_mobile` VALUES (2, 'iPhone', '12pxo max', 1, '王凯凯', '李鸽', '已借出', '2022-06-30 15:10:33', NULL, '2022-07-10 15:10:42', '2022-07-10 15:10:46', NULL);
COMMIT;

-- ----------------------------
-- Table structure for ali_mobile_log
-- ----------------------------
DROP TABLE IF EXISTS `ali_mobile_log`;
CREATE TABLE `ali_mobile_log` (
  `id` int NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `mobile_id` int NOT NULL COMMENT '手机ID',
  `action` varchar(255) COLLATE utf8mb4_general_ci NOT NULL COMMENT '行为：借出，归还',
  `user_name` varchar(255) COLLATE utf8mb4_general_ci NOT NULL COMMENT '用户名（谁借的手机，谁归还的手机）',
  `created_at` datetime DEFAULT NULL COMMENT '添加时间',
  `updated_at` datetime DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of ali_mobile_log
-- ----------------------------
BEGIN;
INSERT INTO `ali_mobile_log` VALUES (1, 0, '借出', '李鸽', '2022-07-11 00:15:37', '2022-07-11 00:15:37');
COMMIT;

-- ----------------------------
-- Table structure for ali_mobile_user
-- ----------------------------
DROP TABLE IF EXISTS `ali_mobile_user`;
CREATE TABLE `ali_mobile_user` (
  `id` int NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '姓名',
  `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime DEFAULT NULL COMMENT '更新时间',
  `deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of ali_mobile_user
-- ----------------------------
BEGIN;
INSERT INTO `ali_mobile_user` VALUES (1, '王凯凯', '2022-07-10 15:09:28', '2022-07-10 15:09:30', NULL);
COMMIT;

-- ----------------------------
-- Table structure for ali_staff
-- ----------------------------
DROP TABLE IF EXISTS `ali_staff`;
CREATE TABLE `ali_staff` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `name` varchar(64) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '姓名',
  `job_no` varchar(32) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '工号，格式00001',
  `mobile` varchar(32) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '手机号',
  `sex` varchar(12) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '男' COMMENT '性别：男/女',
  `leader_id` int NOT NULL COMMENT '汇报上级ID',
  `id_card` varchar(255) COLLATE utf8mb4_general_ci NOT NULL COMMENT '身份证号',
  `birthday` date DEFAULT NULL COMMENT '出生日期',
  `compamy_id` int NOT NULL DEFAULT '0' COMMENT '法人主体ID',
  `company_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '法人主体',
  `department_id` int NOT NULL DEFAULT '0' COMMENT '所在部门ID',
  `department_name` varchar(64) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '所在部门名称',
  `entry_date` date NOT NULL COMMENT '入职日期',
  `confirm_date` date NOT NULL COMMENT '转正日期',
  `status` varchar(32) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '在职' COMMENT '雇佣状态，在职，离职',
  `left_date` date DEFAULT NULL COMMENT '离职日期',
  `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime DEFAULT NULL COMMENT '更新时间',
  `deleted_at` datetime DEFAULT NULL COMMENT '删除日期',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of ali_staff
-- ----------------------------
BEGIN;
INSERT INTO `ali_staff` VALUES (1, '王1', '00001', '', '男', 0, '', '1993-03-03', 1, '阿狸科技有限公司', 2, '人力资源部', '2021-12-29', '2022-05-29', '在职', NULL, '2021-12-29 00:38:14', '2021-12-29 00:38:17', NULL);
INSERT INTO `ali_staff` VALUES (2, '王2', '00002', '', '男', 1, '', '1993-03-03', 1, '阿狸科技有限公司', 3, '员工关系组', '2021-12-29', '2022-05-29', '在职', NULL, '2021-12-29 00:38:14', '2021-12-29 00:38:17', NULL);
INSERT INTO `ali_staff` VALUES (3, '王3', '00003', '', '男', 1, '', '1993-03-03', 1, '阿狸科技有限公司', 4, '产品研发部', '2021-12-29', '2022-05-29', '在职', NULL, '2021-12-29 00:38:14', '2021-12-29 00:38:17', NULL);
INSERT INTO `ali_staff` VALUES (4, '王4', '00004', '', '男', 1, '', '1993-03-03', 2, '太原市阿狸科技有限公司', 5, '产品组', '2021-12-29', '2022-05-29', '在职', NULL, '2021-12-29 00:38:14', '2021-12-29 00:38:17', NULL);
INSERT INTO `ali_staff` VALUES (5, '张一', '00005', '', '女', 2, '', '2022-05-11', 1, '阿狸科技有限公司', 6, '服务端研发组', '2022-05-14', '2022-05-14', '离职中', NULL, '2022-05-14 19:00:31', '2022-05-14 19:00:33', NULL);
INSERT INTO `ali_staff` VALUES (6, '张三', '00006', '', '男', 2, '', '2022-05-14', 1, '阿狸科技有限公司', 7, 'golang开发组', '2022-05-14', '2022-05-14', '在职', NULL, '2022-05-14 19:04:17', '2022-05-14 19:04:19', NULL);
COMMIT;

-- ----------------------------
-- Table structure for ali_task
-- ----------------------------
DROP TABLE IF EXISTS `ali_task`;
CREATE TABLE `ali_task` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '任务主键ID',
  `business` varchar(64) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '所属业务',
  `owner_id` int NOT NULL COMMENT '任务所属人',
  `state` varchar(64) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '新建' COMMENT '任务状态，新建，已消费，失败',
  `created_at` datetime DEFAULT NULL COMMENT '新建时间',
  `updated_at` datetime DEFAULT NULL COMMENT '更新时间',
  `deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of ali_task
-- ----------------------------
BEGIN;
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
